{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Distribution of Operators in Workshop Areas\n", "## Problem Definition\n", "Rick & Morty Inc. is a small workshop that specialises in manufacturing special parts for the metallurgical industry. The firms’ personnel comprises the Director Rick (an Industrial Organisation Engineer), the Designer Morty (an Industrial Design Engineer) and three highly specialised Operators. The workshop has two very different areas (A and B) given the type of machinery in them and the kind of works that can be done with it. The three Operators can move between the two areas as they prefer because they can all work on any of the workshop machines. The Director has noticed that the Operators tend to gather in the same area because their performance is enhanced if they help each other. Nevertheless, leaving an area without Operators for several days is not a good option because the tasks in this area are considerably delayed. By analysing last year’s manufacturing reports, the Director has calculated that the two areas were not occupied by the Operators for 30 % of the days. However, the most worrying aspect is that one area can be void of Operators for several days running. Therefore, the Director has decided to set up the following work plan: at the beginning of the working day, the three Operators will enter a draw to see which of them changes area so no area will be empty for more than 1 day running, or so the Director believes.\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**a)** Consider the problem according to a Markov chain\n", "We can model the problem as a Markov chain with the following states:\n", "\n", "- $s_1$: 0 operators in cell A and 3 operators in cell B\n", "- $s_2$: 1 operator in cell A and 2 operators in cell B\n", "- $s_3$: 2 operators in cell A and 1 operator in cell B\n", "- $s_4$: 3 operators in cell A and 0 operators in cell B\n", "\n", "The period between states is one day. \n", "\n", "Now, at the beginning of each day, the operators will enter a draw to see who must change area. Assuming that each one has a probability of $Pc = 1/3$ to be selected in the draw and change cell, we can calculate the transition probability matrix. For instance, the probability of going from state $s_1$ to state $s_2$ is 1, since there are 3 operators in cell B and one of them must change area. The probability of going from state $s_2$ to state $s_1$ is 1/3, since one of the operators in cell A must change area: \n", "\n", "$3*Pc = 1$\n", "\n", "The probability of going from state $s_2$ to state $s_3$ is 2/3, since the probability of the two operators in cell B to change area is $2*Pc = 2/3$, and the probability of going from state $s_2$ to state $s_1$ is 1/3, since the probability of the operator in cell A to change area is $Pc = 1/3$.\n", "\n", "Following this reasoning yields a transition probability matrix equal to:\n", "\n", "$P^{(1)} = \n", "\\begin{bmatrix}\n", "0 & 1 & 0 & 0 \\\\\n", "1/3 & 0 & 2/3 & 0 \\\\\n", "0 & 2/3 & 0 & 1/3 \\\\\n", "0 & 0 & 1 & 0 \\\\\n", "\\end{bmatrix}$\n", "\n", "The following diagram shows the Markov chain:\n", "\n", "![Rick Markov Chain](img/rick.drawio.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**b)** For what percentage of time will one of the areas be void of Operators?\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can calculate the stationary probabilities since they will tell us which is the probability that the system is at any given state.\n", "\n", "$\\pi_1 = 1/3·\\pi_2$\n", "\n", "$\\pi_2 = \\pi_1 + 2/3·\\pi_3$\n", "\n", "$\\pi_3 = 2/3·\\pi_2 + \\pi_4$\n", "\n", "$\\pi_4 = 1/3·\\pi_3$\n", "\n", "$\\pi_1+\\pi_2+\\pi_3+\\pi_4=1$\n", "\n", "This yields:\n", "\n", "$\\pi_1 = 1/3·\\pi_2$\n", "\n", "$2/3·\\pi_2 = 2/3·\\pi_3$\n", "\n", "$\\pi_4 = 1/3·pi_3$\n", "\n", "$\\pi_1 + 3·\\pi_1 + 3\\pi_1 + \\pi_1 = 1$\n", "\n", "$\\pi_1 = 1/8 = 0.125$\n", "\n", "$\\pi_2 = 3/8 = 0.375$\n", "\n", "$\\pi_3 = 3/8 = 0.375$\n", "\n", "$\\pi_4 = 1/8 = 0.125$\n", "\n", "A will be voi 12.5% of the time and B 12.5% of the time, so one of the areas is going to be void 25% of the time. Rick is not a genius after all." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**c)** On average, how much time passes from there being no Operator in one zone to there being one Operator in it? And the time from an area with no Operator until this same situation occurs again?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is left for future work!" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" }, "pycharm": { "stem_cell": { "cell_type": "raw", "source": [], "metadata": { "collapsed": false } } } }, "nbformat": 4, "nbformat_minor": 2 }